package com.xykj.enterprise.wechat.busi.service.ext;

import com.xykj.enterprise.wechat.bean.ext.BaseResp;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.AddContactWayVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.AddCorpTagVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.ExternalContactListVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.ExternalContactVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.GetContactWayVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.GetCorpTagListVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.GetExternalContactBatchVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.GetFollowUserListVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.GetUnassignedListVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.GroupChatListVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.GroupChatVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.TransferCustomerVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.TransferGroupChatVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.TransferResultVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.moment.GetMomentCommentsVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.moment.GetMomentCustomerListVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.moment.GetMomentListVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.moment.GetMomentSendResultVo;
import com.xykj.enterprise.wechat.bean.ext.externalcontact.moment.GetMomentTaskVo;
import com.xykj.enterprise.wechat.busi.config.ExtClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author zhouxu
 * @create 2021-04-02 17:35
 */
@Service
public class ExternalContactServiceImpl implements ExternalContactService {

    @Autowired
    private ExtClient extClient;

    @Override
    public GetFollowUserListVo getFollowUserList(String accessToken) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("GetFollowUserList", param, GetFollowUserListVo.class);
    }


    @Override
    public AddContactWayVo addContactWayMiniprogram(String accessToken, HashMap<String, Object> params) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("AddContactWay", param, AddContactWayVo.class);

    }

    @Override
    public AddContactWayVo addContactWayQrcode(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("AddContactWay", params, AddContactWayVo.class);

    }

    @Override
    public BaseResp deleteContactWay(String accessToken, String config_id) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("DeleteContactWay", param, BaseResp.class);
    }

    @Override
    public GetContactWayVo getContactWay(String accessToken, String config_id) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("GetContactWay", param, GetContactWayVo.class);
    }

    @Override
    public BaseResp updateContactWay(String accessToken, HashMap<String, Object> params) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("UpdateContactWay", param, GetFollowUserListVo.class);
    }

    @Override
    public ExternalContactListVo externalContactList(String accessToken, String userid) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        param.put("userid", userid);
        return extClient.get("ExternalContactList", param, ExternalContactListVo.class);

    }

    @Override
    public BaseResp externalContactRemark(String accessToken, HashMap<String, Object> params) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("ExternalContactRemark", param, GetFollowUserListVo.class);

    }

    @Override
    public ExternalContactVo getExternalContact(String accessToken, String external_userid) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("GetExternalContact", param, ExternalContactVo.class);

    }

    @Override
    public GetExternalContactBatchVo getExternalContactBatch(String accessToken, String userid, String cursor, Integer limit) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        param.put("userid", userid);
        param.put("cursor", cursor);
        param.put("limit", limit);
        return extClient.get("GetExternalContactBatch", param, GetExternalContactBatchVo.class);

    }

    @Override
    public GetCorpTagListVo getCorpTagList(String accessToken, String[] tag_id, String[] group_id) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        param.put("tag_id", tag_id);
        param.put("group_id", group_id);
        return extClient.get("GetCorpTagList", param, GetCorpTagListVo.class);

    }

    @Override
    public AddCorpTagVo addCorpTag(String accessToken, HashMap<String, Object> params) {
        Map<String, Object> param = new HashMap<>();
        param.put("access_token", accessToken);
        return extClient.get("AddCorpTag", param, AddCorpTagVo.class);

    }

    @Override
    public BaseResp editCorpTag(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("EditCorpTag", params, BaseResp.class);

    }

    @Override
    public BaseResp deleteCorpTag(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("DeleteCorpTag", params, BaseResp.class);

    }

    @Override
    public BaseResp markCorpTag(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("MarkCorpTag", params, BaseResp.class);

    }

    @Override
    public TransferCustomerVo transferCustomer(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("TransferCustomer", params, TransferCustomerVo.class);

    }

    @Override
    public TransferResultVo transferResult(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("TransferResult", params, TransferResultVo.class);
    }

    @Override
    public GetUnassignedListVo getUnassignedList(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetUnassignedList", params, GetUnassignedListVo.class);

    }

    @Override
    public TransferCustomerVo transferResignedCustomer(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("TransferResignedCustomer", params, TransferCustomerVo.class);

    }

    @Override
    public TransferResultVo transferResignedResult(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("TransferResignedResult", params, TransferResultVo.class);

    }

    @Override
    public TransferGroupChatVo transferGroupChat(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("TransferGroupChat", params, TransferGroupChatVo.class);

    }

    @Override
    public GroupChatListVo getGroupChatList(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetGroupChatList", params, GroupChatListVo.class);

    }

    @Override
    public GroupChatVo getGroupChat(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetGroupChat", params, GroupChatVo.class);

    }

    @Override
    public GetMomentListVo getMomentList(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetMomentList", params, GetMomentListVo.class);

    }

    @Override
    public GetMomentTaskVo getMomentTask(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetMomentTask", params, GetMomentTaskVo.class);

    }

    @Override
    public GetMomentCustomerListVo getMomentCustomerList(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetMomentCustomerList", params, GetMomentCustomerListVo.class);

    }

    @Override
    public GetMomentSendResultVo getMomentSendResult(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetMomentSendResult", params, GetMomentSendResultVo.class);
    }

    @Override
    public GetMomentCommentsVo getMomentComments(String accessToken, HashMap<String, Object> params) {
        params.put("access_token", accessToken);
        return extClient.get("GetMomentComments", params, GetMomentCommentsVo.class);
    }

}
